/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 头部导航样式 - Flex布局 */
header {
    background: linear-gradient(to right, #2c3e50, #3498db);
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,10%);
}

.main-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: white;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-item {
    position: relative;
    z-index: 7778;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #f1c40f;
}

/* 子菜单样式 - 浮动布局 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    list-style: none;
    box-shadow: 0 2px 5px rgba(0,0,0,20%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.nav-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    float: left;
    width: 100%;
}

.submenu a {
    display: block;
    padding: 0.8rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.submenu a:hover {
    background-color: #f0f0f0;
}

/* 主要内容区域 - Grid布局 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: #f8f9fa;
    margin-bottom: 2rem;
    border-radius: 10px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    width: 100%;
}

/* 文章样式 */
.blog-post {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,10%);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.blog-post.visible {
    opacity: 1;
    transform: translateY(0);
}

.post-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,10%);
}

.post-item h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* 侧边栏样式 */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,10%);
    height: fit-content;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 1rem 0;
    transition: transform 0.3s;
}

.avatar:hover {
    transform: scale(1.05);
}

/* 页脚样式 */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero, .blog-post, .sidebar {
    animation: fadeIn 0.8s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,10%);
    }
} 

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 20px;
    transition: background-color 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    background: #3498db;
}

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #f1c40f;
    z-index: 1001;
    transition: width 0.1s;
}

/* 搜索框样式 */
.search-box {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
}

#search-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#search-input:focus {
    border-color: #3498db;
    outline: none;
}

#search-btn {
    padding: 0.8rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-btn:hover {
    background: #2980b9;
}

/* 文章样式增强 */
.post-header {
    margin-bottom: 1rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-meta span {
    margin-right: 1rem;
}

.post-image {
    width: 100%;
    border-radius: 10px;
    margin: 1rem 0;
}

.post-tags {
    margin: 1rem 0;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f0f0f0;
    border-radius: 15px;
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    transition: background-color 0.3s;
}

.tag:hover {
    background: #e0e0e0;
}

.post-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* 分享按钮 */
.share-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
    transition: opacity 0.3s;
}

.share-btn:hover {
    opacity: 0.8;
}

.share-btn.weixin {
    background: #07C160;
}

.share-btn.weibo {
    background: #E6162D;
}

.share-btn.qq {
    background: #12B7F5;
}

/* 侧边栏部件通用样式 */
.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,10%);
    margin-bottom: 2rem;
}

/* 社交链接 */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.social-link:hover {
    color: #3498db;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag-item {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.tag-item:hover {
    color: #3498db;
}

/* 评论列表 */
.comment-list {
    list-style: none;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.commenter-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
}

.commenter-name {
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }

    .share-buttons {
        flex-wrap: wrap;
    }

    .comment-item {
        flex-direction: column;
    }

    .commenter-avatar {
        width: 40px;
        height: 40px;
    }
}

/* 主题切换 */
:root {
    --bg-color: #fff;
    --text-color: #333;
    --header-bg: linear-gradient(to right, #2c3e50, #3498db);
    --card-bg: #fff;
    --border-color: #eee;
    --hover-color: #f0f0f0;
    --link-color: #3498db;
    --shadow: 0 2px 5px rgba(0,0,0,10%);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --header-bg: linear-gradient(to right, #1a1a1a, #2c3e50);
    --card-bg: #2d2d2d;
    --border-color: #444;
    --hover-color: #3d3d3d;
    --link-color: #5dade2;
    --shadow: 0 2px 5px rgba(0,0,0,30%);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* 主题切换按钮 */
.theme-toggle {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    margin-left: 1rem;
}

.theme-toggle .dark-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .light-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .dark-icon {
    display: inline;
}

/* 评论表单样式 */
.comment-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--link-color);
    outline: none;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.submit-btn {
    background: var(--link-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* 文章分类标签 */
.post-category {
    background: var(--hover-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* 夜间模式适配 */
[data-theme="dark"] .widget,
[data-theme="dark"] .blog-post,
[data-theme="dark"] .search-box input {
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .tag,
[data-theme="dark"] .post-category {
    background: var(--hover-color);
    color: var(--text-color);
}

[data-theme="dark"] .nav-link:hover {
    color: var(--link-color);
}

[data-theme="dark"] .submenu {
    background: var(--card-bg);
}

[data-theme="dark"] .submenu a {
    color: var(--text-color);
}

[data-theme="dark"] .submenu a:hover {
    background: var(--hover-color);
}

/* 文章分类过滤时的动画 */
.post-item {
    transition: opacity 0.3s, transform 0.3s;
}

.post-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 文章目录导航 */
.post-toc {
    position: sticky;
    top: 20px;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin: 0.8rem 0;
}

.toc-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.toc-list a:hover {
    color: var(--link-color);
}

/* 热门文章 */
.popular-list {
    list-style: none;
    padding: 0;
}

.popular-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-image {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
}

.popular-content {
    flex: 1;
}

.popular-content h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--text-color);
}

.popular-views {
    font-size: 0.8rem;
    color: #666;
}

/* 文章归档 */
.archive-list {
    list-style: none;
    padding: 0;
}

.archive-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s;
}

.archive-link:hover {
    color: var(--link-color);
}

.archive-count {
    color: #666;
    font-size: 0.9rem;
}

/* 文章分类标题 */
.blog-post h3 {
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .post-toc {
        position: static;
        margin-bottom: 1rem;
    }

    .popular-item {
        flex-direction: row;
    }

    .archive-link {
        flex-direction: row;
    }
}

/* 夜间模式适配 */
[data-theme="dark"] .popular-views,
[data-theme="dark"] .archive-count {
    color: #999;
}

[data-theme="dark"] .blog-post h3 {
    border-bottom-color: var(--border-color);
}

/* 添加在文件开头 */
html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
    visibility: visible !important;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 添加页面加载动画 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.page-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--hover-color);
    border-top-color: var(--link-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 添加发布按钮样式 */
.publish-btn-nav {
    padding: 0.5rem 1.5rem;
    background: #f1c40f;
    color: #2c3e50;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    margin-left: 1rem;
    text-decoration: none;
}

.publish-btn-nav:hover {
    background: #f39c12;
    transform: translateY(-2px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #34495e;
    --text-tertiary: #7f8c8d;
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;
    --border-color: #e1e4e8;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    --header-gradient: linear-gradient(135deg, #3498db, #2980b9);
}

[data-theme="dark"] {
    --bg-primary: #1a1b1e;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #ecf0f1;
    --text-tertiary: #bdc3c7;
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;
    --border-color: #34495e;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    --header-gradient: linear-gradient(135deg, #2c3e50, #2980b9);
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* 导航栏样式 */
header {
    background: var(--header-gradient);
    padding: 0;
    box-shadow: var(--card-shadow);
}

.main-nav {
    background: transparent;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
}

.logo a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: white;
}

/* 内容区域样式 */
main {
    background-color: var(--bg-primary);
    min-height: calc(100vh - 200px);
    padding-bottom: 4rem;
}

.content-grid {
    background: transparent;
}

/* 卡片样式 */
.widget, .blog-post, .article-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.widget:hover, .blog-post:hover, .article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 分类头��样式 */
.category-header {
    background: var(--header-gradient);
    color: white;
    padding: 3rem 2rem;
    margin: -2rem -1rem 2rem;
    border-radius: 0;
    text-align: center;
}

.category-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.category-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

/* 搜索框样式 */
.search-box {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.search-box input {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* 标签样式 */
.tag {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    transition: background-color 0.3s;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

/* 发布按钮样式 */
.publish-btn-nav {
    background: #f1c40f;
    color: #2c3e50;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.publish-btn-nav:hover {
    background: #f39c12;
    transform: translateY(-2px);
    color: #2c3e50;
}

/* 页脚样式 */
footer {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-header {
        margin: -1rem -1rem 2rem;
        padding: 2rem 1rem;
    }
    
    .category-header h2 {
        font-size: 2rem;
    }
}

/* 主题切换按钮 */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.6rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 文章列表样式优化 */
.article-list {
    display: grid;
    gap: 2rem;
}

.article-card {
    padding: 1.5rem;
    margin-bottom: 0;
}

.article-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.article-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.article-meta {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 侧边栏优化 */
.sidebar .widget {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.widget h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.social-links {
    margin-top: 1.5rem;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.social-link:hover {
    color: var(--primary-color);
}

/* 热门文章列表样式 */
.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.popular-item:last-child {
    border-bottom: none;
}

.popular-item:hover {
    transform: translateX(5px);
}

.popular-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.popular-content {
    flex: 1;
}

.popular-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s;
}

.popular-item:hover .popular-content h4 {
    color: var(--primary-color);
}

.popular-views {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .popular-item {
        padding: 0.8rem 0;
    }
    
    .popular-image {
        width: 50px;
        height: 50px;
    }
    
    .popular-content h4 {
        font-size: 0.9rem;
    }
}
  